<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.8.0.js"></script>
</head>
<body>
	<s:a namespace="/pages_v1" action="database" method="listAllDatabase">listAllDatabase</s:a>
	<a href="<s:url action="index" namespace="config-browser" />">Launch the configuration browser</a>
	
	<script>
	function clickForm(action){
		$("#form").unbind('submit').bind("submit",function(){
	         var thistarget = this.target;
	         jQuery.ajax({
	             data: $(this).serialize(),
	             url: action,
	             type: this.method,
	             error: function() {
	                 $(thistarget).html("<span class='error'>Failed to submit form!</span>");
	             },
	             success: function(results) {
	                 $("#"+thistarget).html(results);
	             }
	         })
	         return false;
	         }
	    );
		
	}
	</script>
	
	<form id="form">
		<button onclick="return clickForm('1')">1</button>
		<button onclick="return clickForm('2')">2</button>
	</form>
</body>
</html>
